<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="../style/authority/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="../style/authority/common_style.css" rel="stylesheet" type="text/css">
    <link href="../style/authority/zTreeStyle.css" rel="stylesheet" type="text/css">
    <link href="../css/UserAdmin.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="../style/bootstrap.min.css"/>
    <script type="text/javascript" src="../scripts/jquery/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="../scripts/zTree/jquery.ztree.core-3.2.js"></script>
    <!--<script type="text/javascript" src="../scripts/fancybox/jquery.fancybox-1.3.4.js"></script>-->
    <!--<script type="text/javascript" src="../scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>-->
    <!--<link rel="stylesheet" type="text/css" href="../style/authority/jquery.fancybox-1.3.4.css" media="screen"/>-->
    <!--</link>-->
    <!--<script type="text/javascript" src="../scripts/artDialog/artDialog.js?skin=default"></script>-->
    <script type="text/javascript" src="../js/UserAdmin.js"></script>

    <title>信息管理系统</title>
    <!--<script type="text/javascript">-->
    <!--</script>-->
    <!--<style type="text/css">-->
    <!--</style>-->
</head>

<body>
<div id="container">
    <div id="sider">
        <!--
            这里对上面的树桩菜单栏js代码段
        <ul id="tree" class="ztree"></ul>
        -->
        <div class="tree well ">
            <!--左边树形菜单栏-->
            <ul style="width:280px;">
                <li>
                        <span><i class="glyphicon glyphicon-option-horizontal"></i>
                            <a th:href="@{/user/userAdmin}">
                                打开全部
                            </a>
                        </span>
                    <ul th:each="institution : ${institutions}" th:Object="${institution}">
                        <li>
                                <span><i class="glyphicon glyphicon-option-vertical"></i>
                                    <a th:href="@{/user/userAdmin?department=}+*{id}">
                                        <span th:text="*{auditname}"></span>
                                    </a>
                                </span>
                        </li>
                    </ul>
                </li>
            </ul>

        </div>
    </div>
    <div id="main">
        <div>
            <div style="background-color: #E7E7E7;">
                <div class="container">
                    <a href="#" data-toggle="modal" data-target="#insert">
                        <span class="glyphicon glyphicon-plus" style="color: #00B83F;"></span> 增加
                    </a>&nbsp;&nbsp;
                    <a href="#" onclick="js_delete()">
                        <span class="glyphicon glyphicon-remove" style="color:#990000;"></span> 删除
                    </a>&nbsp;&nbsp;
                    <a href="#" onclick="js_method()" id="updateA">
                        <span class="glyphicon glyphicon-pencil" style="color: #02397F;"></span> 修改信息
                    </a>&nbsp;&nbsp;
                    <a href="#" onclick="js_unsteady()">
                        <input type="hidden" id="unsteady" name="unsteady" value="OK">
                        <span class="glyphicon glyphicon-off" style="color:#990000;"></span> 禁用|启用
                    </a>&nbsp;&nbsp;
                    <a href="#" onclick="resetPwd()">
                        <span class="glyphicon glyphicon-refresh"></span> 重置密码
                    </a>
                </div>
            </div>
        </div>
        <!--增加的模态框-->
        <div class="modal fade" id="insert">
            <div class="modal-dialog">
                <div class="modal-content" style="width: 450px;">
                    <div class="modal-header">
                        <button class="close" data-dismiss="modal">×</button>
                        <p>
                            <span style="font-size:16px; font-weight:normal">增加用户</span>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <span id="hint" style="color: red"></span>
                        </p>
                    </div>
                    <form action="/user/userAdd" method="post" onSubmit="return addUser(this)">
                        <div class="media-body container">
                            <br>
                            <table class="table table-condensed col-md-12">
                                <tr valign="middle" align="center">
                                    <td>用户iD:</td>
                                    <td><input type="text" id="username" name="username"/></td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>姓名:</td>
                                    <td><input type="text" id="name" name="name"/></td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>部门:</td>
                                    <td>
                                        <select name="department" id="department" style="width: 182px;height: 25px">
                                            <option value="0">--请选择部门--</option>
                                            <option th:each="institution : ${institutions}"
                                                    th:Object="${institution}"
                                                    th:value="*{id}" th:text="*{auditname}"></option>
                                        </select>
                                    </td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>角色:</td>
                                    <td>
                                        <select name="userRole" id="userRole" style="width: 182px;height: 25px">
                                            <option value="0">--请选择角色--</option>
                                            <option th:each="role : ${roleList}" th:Object="${role}"
                                                    th:value="*{id}" th:text="*{rolename}"></option>
                                        </select>
                                    </td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>岗位:</td>
                                    <td>
                                        <select name="post" id="post" style="width: 182px;height: 25px">
                                            <option value="-1">--请选择岗位--</option>
                                            <option value="0">总经理</option>
                                            <option value="1">经理</option>
                                            <option value="2">副经理</option>
                                            <option value="3">稽核员</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>人员资源:</td>
                                    <td><input type="text" id="userAptitude" name="userAptitude"/></td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>密码:</td>
                                    <td><input type="text" id="password" name="password"/></td>
                                </tr>
                            </table>
                        </div>
                        <div class="modal-footer">
                            <button type="submit" class="btn btn-info btn-block">提交</button>
                            <input type="reset" class="btn btn-warning btn-block" value="重置"/>
                            <!--这可是你说不要把他包住的，怪不了我！！！！-->
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--结束-->
        <!--修改的模态框-->
        <div class="modal fade" id="update">
            <div class="modal-dialog">
                <div class="modal-content" style="width: 450px;">
                    <div class="modal-header">
                        <button class="close" data-dismiss="modal">×</button>
                        <p>
                            <span style="font-size:16px; font-weight:normal">修改用户</span>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <span id="updateHint" style="color: red"></span>
                        </p>
                    </div>
                    <form action="/user/userUpdate" method="post" onSubmit="return updateUser(this)">
                        <div class="media-body container">
                            <br>
                            <input type="hidden" id="UserId" name="id">
                            <input type="hidden" id="pwd" name="password">
                            <table class="table table-condensed col-md-12">
                                <tr valign="middle" align="center">
                                    <td>用户iD:</td>
                                    <td><input type="text" id="username2" name="username"/></td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>姓名:</td>
                                    <td><input type="text" id="name2" name="name"/></td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>部门:</td>
                                    <td>
                                        <select name="department" id="department2" style="width: 182px;height: 25px">
                                            <option value="0">--请选择部门--</option>
                                            <option th:each="institution : ${institutions}"
                                                    th:Object="${institution}"
                                                    th:value="*{id}" th:text="*{auditname}"></option>
                                        </select>
                                    </td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>角色:</td>
                                    <td>
                                        <select name="userRole" id="userRole2" style="width: 182px;height: 25px">
                                            <option value="0">--请选择角色--</option>
                                            <option th:each="role : ${roleList}" th:Object="${role}"
                                                    th:value="*{id}" th:text="*{rolename}"></option>
                                        </select>
                                    </td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>岗位:</td>
                                    <td>
                                        <select name="post" id="post2" style="width: 182px;height: 25px">
                                            <option value="-1">--请选择岗位--</option>
                                            <option value="0">总经理</option>
                                            <option value="1">经理</option>
                                            <option value="2">副经理</option>
                                            <option value="3">稽核员</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr valign="middle" align="center">
                                    <td>人员资源:</td>
                                    <td><input type="text" id="userAptitude2" name="userAptitude"/></td>
                                </tr>
                            </table>
                        </div>
                        <div class="modal-footer">
                            <button type="submit" class="btn btn-info btn-block">提交</button>
                            <input type="reset" class="btn btn-warning btn-block" value="重置"/>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--结束-->
        <div>

            <table class="table table-bordered">
                <thead>
                <tr>
                    <th class="text-center" width="100px">
                        <input type="checkbox" id="all"/>
                    </th>
                    <th class="text-center">用户Id</th>
                    <th class="text-center">姓名</th>
                    <th class="text-center">角色</th>
                    <th class="text-center">部门</th>
                    <th class="text-center">岗位</th>
                    <th class="text-center">状态</th>
                    <th class="text-center">人员资质</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="user : ${userAll.dataS}" th:Object="${user}">
                    <td>
                        <input type="checkbox" name="box" th:value="*{user.id}"/>
                        <input type="hidden" th:id="*{user.id}" th:value="*{user.status}">
                    </td>
                    <td th:text="*{user.username}"></td>
                    <td th:text="*{user.name}"></td>
                    <td th:text="*{roleManager.rolename}"></td>
                    <td th:text="*{auditInstitution.auditname}"></td>
                    <td th:text="总经理" th:if="*{user.post == 0}"></td>
                    <td th:text="经理" th:if="*{user.post == 1}"></td>
                    <td th:text="副经理" th:if="*{user.post == 2}"></td>
                    <td th:text="稽核员" th:if="*{user.post == 3}"></td>
                    <td th:text="停用" th:if="*{user.status == 0}"></td>
                    <td th:text="正常" th:if="*{user.status == 1}"></td>
                    <td th:text="*{user.userAptitude}"></td>
                </tr>

                </tbody>
            </table>
            <div class="ui_tb_h30">
                <div class="ui_flt" style="height: 30px; line-height: 30px;">

                    <span class="ui_txt_bold04" th:text="'共有 '+${userAll.pageCount} + ' 条记录，当前第 '"></span>
                    <span class="ui_txt_bold04" th:text="${pager}+'/'+${userAll.pageCount}+' 页'"></span>
                    <input id="pageCount" type="hidden" th:value="${userAll.pageCount}">
                    <input id="pager" type="hidden" th:value="${pager}">
                </div>
                <div class="ui_frt">
                    <!--    如果是第一页，则只显示下一页、尾页 -->
                    <a href="/user/userAdmin?page=1">
                        <input type="button" value="首页" class="ui_input_btn01"/>
                    </a>
                    <a th:href="@{/user/userAdmin?page=}+(${pager-1}<1?1:${pager-1})">
                        <input type="button" value="上一页" class="ui_input_btn01"/>
                    </a>
                    <a th:href="@{/user/userAdmin?page=}+(${pager+1}>${userAll.pageCount}?${userAll.pageCount}:${pager+1})">
                        <input type="button" value="下一页" class="ui_input_btn01"/>
                    </a>
                    <a th:href="@{/user/userAdmin?page=}+${userAll.pageCount}">
                        <input type="button" value="尾页" class="ui_input_btn01"/>
                    </a>
                    <!--     如果是最后一页，则只显示首页、上一页 -->
                    转到第<input type="text" id="jumpNumTxt" class="ui_input_txt01" value=""/>页
                    <input type="button" class="ui_input_btn01" value="跳转" onclick="fun_a()"/>
                </div>
            </div>

        </div>

    </div>
</div>
<div style="display:none">
    <script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script>
</div>
</body>
<script type="text/javascript" src="../scripts/jquery.js"></script>
<script type="text/javascript" src="../scripts/bootstrap.js"></script>
<script type="text/javascript">
    $(function () {
        $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
        $('.tree li.parent_li > span').on('click', function (e) {
            var children = $(this).parent('li.parent_li').find(' > ul > li');
            if (children.is(":visible")) {
                children.hide('fast');
                $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
            } else {
                children.show('fast');
                $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
            }
            e.stopPropagation();
        });
    });
</script>

</html>
<!--
	作者：抛抛
	时间：2019-05-10
	描述：
-->